package com.eric.code.image;

import org.imgscalr.Scalr;

import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

/**
 * Hello world!
 *
 */
public class App 
{
	public static void main(String[] args) throws IOException {


		try {
			FileInputStream in = new FileInputStream(new File("/home/eric/old.gif"));
			FileOutputStream out = new FileOutputStream(new File("/home/eric/aaa.gif"));
			ImageUtil.resizeGif(in, out, 300, 200, 0.85f, new String[] {"@王少-_-","weibo.com/dragonsoar"}, ImageUtil.FONT, ImageUtil.FONT_SHADOW_COLOR);

//            FileInputStream in = new FileInputStream(new File("/home/eric/jpg.jpg"));
//            FileOutputStream out = new FileOutputStream(new File("/home/eric/scale_jpg.jpg"));
//            resizeJpg(in, out, 500, 500, 0.85f, new String[] {"@王少-_-","weibo.com/dragonsoar"}, FONT, FONT_SHADOW_COLOR);


			out.close();
			in.close();
		} catch (Exception e) {
			e.printStackTrace();
		}

	}
}
